﻿
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>" />
<sx:head extraLocales="en-us" />
<title>订货单</title>
<link rel="stylesheet" href="css/main.css" type="text/css" />
<script language="javascript" src="script/main.js"></script>
<script type='text/javascript' src='dwr/interface/employeeAction.js'></script>
<script type='text/javascript' src='dwr/engine.js'></script>
<script type='text/javascript' src='dwr/util.js'></script>
<script type="text/javascript">
	var codeChk = false;

	function formSubmit() {
		var chk = false;

		var chkRetName = out_chkMaxLength('name', 'msg_name', '名称小于10位且不能为空!',
				'10');
		var chkRetDate = out_pickerDate('p_date', 'msg_date', '日期不能为空!');
		var chkRetPhone = out_chkPhone('phone', 'msg_phone', '电话只能输入11位或12位数字!');
		var chkRetEmail = out_chkEmail('email', 'msg_email',
				'EMAIL小于30位且不能为空!', 30);
		var chkRetSex = out_chkEmpty('sex', 'msg_sex', '性别不能为空!')
		if (chkRetName && chkRetPhone && chkRetEmail && chkRetSex && chkRetDate) {
			chk = true;
		}
		return chk;
	}
	dojo.event.topic.subscribe("/value", function(textEntered, date, widget) {

		out_pickerDate('p_date', 'msg_date', '日期不能为空!');

	});
	window.onload = init;
</script>
</head>
<body>

<p></p>
<s:form action="employeeAction" method="post" theme="simple" onsubmit="return formSubmit();">
	<s:hidden name="employee.id"></s:hidden>
	<s:hidden name="employee.code"></s:hidden>
	<p><font style="font-size: 10pt;">档案管理->员工档案->修改</font></p>

	<p></p>
	<table border="0" cellpadding="1" cellspacing="1" width="95%">
		<tr>
			<td align="right" width="10%" nowrap="true">员工编号</td>
			<td width="20%"><s:textfield name="employee.code"
				cssClass="TextInput" disabled="true" ></s:textfield></td>
			<td align="right" width="10%" nowrap="true">员工名称</td>
			<td width="20%"><s:textfield name="employee.name"
				cssClass="TextInput"  id="name"
				onFocus="show_message('msg_name','2','请输入名称');"
				onBlur="out_chkMaxLength('name', 'msg_name', '名称小于10位且不能为空!', 10)"></s:textfield>
			<DIV style="DISPLAY: show" id="msg_name" class="box_div_right">&nbsp;</DIV></td>
			<td align="right" width="10%">出生年月日</td>
			<td width="20%"><sx:datetimepicker label=""
				name="employee.birthday" displayFormat="yyyy-MM-dd" language="en-us"
				type="date" id="p_date" required="true" valueNotifyTopics="/value" />
			<DIV style="DISPLAY: show" id="msg_date" class="box_div_right">&nbsp;</DIV></td>
			<td width="10%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap="true">员工性别</td>
			<td width="20%"><s:select label="员工性别" name="employee.sex"
				list="#{true:'男',false:'女'}" emptyOption="true" id="sex" onFocus="show_message('msg_sex','2','请选择供性别!')"
				onBlur="out_chkEmpty('sex','msg_sex','性别不能为空!')"></s:select>
			<DIV style="DISPLAY: show" id="msg_sex" class="box_div_right">&nbsp;</DIV></td>
			<td align="right" width="10%" nowrap="true">员工电话</td>
			<td width="20%"><s:textfield name="employee.telephone"
				cssClass="TextInput" id="phone"
				onFocus="show_message('msg_phone','2','请输入电话11位或12位数字.');"
				onBlur="out_chkPhone('phone', 'msg_phone', '电话只能输入11位或12位数字!')"></s:textfield>
			<DIV style="DISPLAY: show" id="msg_phone" class="box_div_right">&nbsp;</DIV></td>
			<td width="10%" align="right" nowrap="true">员工Email</td>
			<td width="20%"><s:textfield name="employee.email"
				cssClass="TextInput" id="email"
				onFocus="show_message('msg_email','2','请输入EMAIL');"
				onBlur="out_chkEmail('email', 'msg_email', 'EMAIL小于30位且不能为空!', 30)"></s:textfield>
			<DIV style="DISPLAY: show" id="msg_email" class="box_div_right">&nbsp;</DIV></td>
			<td colspan="3">&nbsp;</td>
		</tr>
	</table>

	<p></p>
	<div style="margin-left: 30px; margin-right: 0px">
	<table border="0" cellpadding="0" cellspacing="0" width="95%">
		<tr>
			<td width="10%"><s:submit value="保存" method="updateEmployee"
				cssClass="BtnAction"></s:submit></td>
			<td width="10%"><input type="button" class="BtnAction"
				value="返回" onClick="history.go(-1);"></td>
			<td width="80%">&nbsp;</td>
		</tr>
	</table>
	</div>
</s:form>
</body>
</html>